Solutions: Mathematica 6 Lab 1

Problem 1:

(∫_0^π)Cos[x Sin[θ]]\[DifferentialD]θ

Plot[%,{x,0,20}]

Plot[Evaluate[(∫_0^π)Cos[x Sin[θ]]\[DifferentialD]θ],{x,0,20}]

?Evaluate

Problem 2:

Hyperlink["FibonacciBiography","http://en.wikipedia.org/wiki/Fibonacci"]

((Fibonacci[51])/(Fibonacci[50]))//N

((Fibonacci[101])/(Fibonacci[100]))//N

((Fibonacci[100])/(Fibonacci[101]))//N

Solve[x==1+(1/x),x]

(1/2) (1+(Sqrt[5]))//N

GoldenRatio//N

b=(1/2) (1+(Sqrt[5]))

Log[Fibonacci[50]]-50Log[b]//N
Log[Fibonacci[100]]-100Log[b]//N

Log[1/(Sqrt[5])]//N

a=1/(Sqrt[5])

N[((Fibonacci[50])/(a (b^50))),40]
N[((Fibonacci[100])/(a (b^100))),40]

Clear[k,x]

(∑_(k=0)^∞)(1/(k!))Fibonacci[k](x^k)

Series[%,{x,0,6}]

Simplify[%]

logfib=Table[Log[Fibonacci[k]],{k,1,100}]//N

FibonacciPoints=ListPlot[logfib]

FibonacciLine=Plot[Log[a (b^n)] ,{n,0,100}]

Show[FibonacciPoints, FibonacciLine]

Problem 3:

ParametricPlot[{Sin[5t]Cos[2t],Sin[3t]Sin[2t]},{t,0,2π}]

ParametricPlot[{Sin[5t]Cos[2t],Sin[3t]Sin[2t]},{t,0,2π},Axes->None,Frame->True]

ParametricPlot[{Sin[5t]Cos[2t],Sin[3t]Sin[2t]},{t,0,2π},Axes->None,Frame->False,Ticks->False]

Problem 4:

f1[x_]:=Sin[x]
f2[x_]:=((Sin[x])^2)
f7[x_]:=((Sin[x])^7)
f8[x_]:=((Sin[x])^8)

g1=Plot[f1[x],{x,0,2π},PlotRange->All]
g2=Plot[f2[x],{x,0,2π},PlotRange->All]
g7=Plot[f7[x],{x,0,2π},PlotRange->All]
g8=Plot[f8[x],{x,0,2π},PlotRange->All]

Show[GraphicsArray[{{g1,g2},{g7,g8}}]]

Problem 5:

f[x_]:=(∑_(k=1)^30)(1/(k+(k^(1/3))))Sin[2π k x]

Plot[f[x],{x,0,2}]//Timing

Problem 6:

ContourPlot[(1/((((x-1))^2)+(((y-1))^2)))-(3/((((x-1))^2)+(((y+1))^2)))+(1/((((x+1))^2)+(((y+1))^2)))-(3/((((x+1))^2)+(((y-1))^2))), {x,-10,10},{y,-10,10}]

ContourPlot[(1/((((x-1))^2)+(((y-1))^2)))-(3/((((x-1))^2)+(((y+1))^2)))+(1/((((x+1))^2)+(((y+1))^2)))-(3/((((x+1))^2)+(((y-1))^2))), {x,-10,10},{y,-10,10},PlotPoints->100]

ContourPlot[(1/((((x-1))^2)+(((y-1))^2)))-(3/((((x-1))^2)+(((y+1))^2)))+(1/((((x+1))^2)+(((y+1))^2)))-(3/((((x+1))^2)+(((y-1))^2))), {x,-10,10},{y,-10,10},ContourShading->False]

ContourPlot[(x^2)+((y^2)/4)==1,{x,-3,3},{y,-3,3}, Frame->False,Axes->True]